package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.OssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Leimin
 * @date 2022/05/10 09:14
 **/
@RestController
@Api(tags = "阿里云文件上传接口")
@RequestMapping("/aliyunOss")
public class OssController {
    @Autowired
    private OssService ossService;

    @PostMapping(value = "/upload")
    @ApiOperation("上传")
    public ResponseEntity upload(@ApiParam(name = "file", value="文件")@RequestPart("file") MultipartFile file)  {
        return ossService.upload(file);
    }
}


